#ifndef AFTP_CLINET_X_H
#define AFTP_CLINET_X_H

#ifdef __cplusplus
extern "C" {
#endif


typedef struct {
	void* aftp_alient_inner;
} AFTP_CLIENT;

typedef struct {
	int code;
	char* message;
	int data_length;
	void* data;
} AFTP_RESULT;

typedef struct {
	__int64 create_time;
	__int64 uploaded_size;
	__int64 total_size;
} AFTP_DATA_INFO;

typedef void (__stdcall *upload_file_progress_handle)(int percent, void* param);


AFTP_CLIENT*	__stdcall aftp_create_client(const char* address, int port);
void			__stdcall aftp_close_client(AFTP_CLIENT* client);

void			__stdcall aftp_release_result(AFTP_RESULT* result);
const char*		__stdcall aftp_get_last_error();

AFTP_RESULT*	__stdcall aftp_ping(AFTP_CLIENT* client);
AFTP_RESULT*	__stdcall aftp_auth(AFTP_CLIENT* client, const char* username, const char* password);
AFTP_RESULT*	__stdcall aftp_create_token(AFTP_CLIENT* client);
AFTP_RESULT*	__stdcall aftp_check(AFTP_CLIENT* client, const char* token, const char* checkcode);
AFTP_RESULT*	__stdcall aftp_info(AFTP_CLIENT* client, const char* token);
AFTP_RESULT*	__stdcall aftp_reset(AFTP_CLIENT* client, const char* token);
AFTP_RESULT*	__stdcall aftp_upload(AFTP_CLIENT* client, const char* token, long length, const char* data);
AFTP_RESULT*	__stdcall aftp_upload_file(AFTP_CLIENT* client, const char* token, const char* filename, upload_file_progress_handle fun, void* param);
AFTP_RESULT*	__stdcall aftp_commit(AFTP_CLIENT* client, const char* token, const char* tag);


#ifdef __cplusplus
}
#endif




#endif //AFTP_CLINET_X_H
